package com.xbongbong.paas.controller;

import com.xbongbong.paas.service.PaasAppService;
import com.xbongbong.pro.constant.XbbProConstant;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 吴峰
 * @date 2019/1/14 10:47
 * @desrcption 应用管理
 */
@RestController
@RequestMapping(value = XbbProConstant.API_ROOT_PREFIX + "/app")
public class ProAppController  {

    @Resource
    private PaasAppService paasAppService;


    /**
     * 启用应用
     * @param appEnableDTO
     * @param br
     * @return
     * @throws Exception
     */
//    @RequestMapping(value = "/enable", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
//    public String enable(@RequestBody @Valid AppEnableDTO appEnableDTO, BindingResult br) throws Exception {
//        XbbResponse<AppEnableVO> response;
//        if (br.hasErrors()) {
//            String errMsg = Objects.requireNonNull(br.getFieldError()).getDefaultMessage();
//            response = new XbbResponse<>(SystemErrorCodeEnum.API_ERROR_100002, errMsg);
//        } else {
//            try {
//                AppEnableVO appEnableVO = this.paasAppService.enableApp(appEnableDTO);
//                response = new XbbResponse<>(appEnableVO);
//            } catch (XbbException e) {
//                response = new XbbResponse<>(e);
//            }
//        }
//        return JSON.toJSONString(response);
//    }
}
